//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Collections.Generic;
using OpenLS.Core.Serialization;

namespace OpenLS.Chart
{
    internal sealed class CannonicalNumericReference : NumericReference
    {
        private string _formula;

        protected override void ReadXmlCore(ReadContext context)
        {
            using (var c = context.Read("numRef"))
            {
                this._formula = c.ReadElementString("f");
                Cache = c.ReadOptionalElementAs<NumericLiteral>("numCache");
                if (Cache != null)
                    Cache.Parent = this;
                Extension = c.ReadOptionalElement<ExtensionElement>("extLst");
            }
        }
        public override IEnumerable<NumericValue> NumericValues
        {
            get { throw new NotImplementedException(); }
        }

        public override string Formula
        {
            get { return _formula; }
        }
    }
}